import Router from 'koa-router';
import proxyService from '../../../common/proxyService';
import {
  saveComplaint,
  getComplaintUrl,
  deleteComplaint,
  getComplaintInfo,
  getComplaintList,
  getActivityList,
  updateVerificationComplaint,
} from '../../../api';

const router = new Router();
router.get('/saveComplaint', async ctx => {
  console.log(ctx.request.query);
  const response = await proxyService.postProxy(ctx, saveComplaint);
  return (ctx.body = response);
});
router.get('/updateVerificationComplaint', async ctx => {
  console.log(ctx.request.query);
  const response = await proxyService.postProxy(ctx, updateVerificationComplaint);
  return (ctx.body = response);
});
router.get('/getComplaintUrl', async ctx => {
  console.log(ctx.request.query);
  const response = await proxyService.postProxy(ctx, getComplaintUrl);
  return (ctx.body = response);
});
router.post('/deleteComplaint', async ctx => {
  console.log(ctx.request.query);
  const response = await proxyService.postProxy(ctx, deleteComplaint);
  return (ctx.body = response);
});
router.get('/getComplaintInfo', async ctx => {
  console.log(ctx.request.query);
  const response = await proxyService.postProxy(ctx, getComplaintInfo);
  return (ctx.body = response);
});
router.get('/getComplaintList', async ctx => {
  console.log(ctx.request.query);
  const response = await proxyService.postProxy(ctx, getComplaintList);
  return (ctx.body = response);
});
router.get('/getActivityList', async ctx => {
  console.log(ctx.request.query);
  const response = await proxyService.postProxy(ctx, getActivityList);
  return (ctx.body = response);
});

export default router;
